package cn.chinaunicom.sdsi.gacx.web.controller;

import cn.chinaunicom.sdsi.frm.base.BaseController;
import cn.chinaunicom.sdsi.gacx.author.service.AuthorService;
import cn.chinaunicom.sdsi.gacx.web.service.SelectBaseInfoService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;


import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import net.sf.json.JSONObject;

/**
 * @author chenxl add by 2017-6-16
 * 
 *         api接口 伪REST风格服务
 *
 */

@Controller
@RequestMapping("/openapi")
public class RestServiceController extends BaseController {

	private final Log log = LogFactory.getLog(RestServiceController.class);

	@Autowired
	private SelectBaseInfoService selectBaseInfoService;

	/**
	 * 基本信息查询
	 * 
	 */
	@RequestMapping(value = "/selectBaseInfo", method = RequestMethod.POST)
	@ResponseBody
	public JSONObject selectBaseInfo(@RequestBody HashMap<String, Object> requestMap) {
		log.debug("selectBaseInfo begin ....." + requestMap.toString());
		//requestMap.put("method", "selectBaseInfo");
		JSONObject obj = selectBaseInfoService.selectBaseInfo(requestMap);
		System.out.println("print task = " + obj);
		return obj;
	}

}